#include <iostream>
#include <vector>
#include <xexec.h>

using namespace std;
int main(int argc, char const *argv[])
{
    XExec exec;
    exec.Start("ping www.baidu.com");

    string s;
    while (exec.Running())
    {
        if (exec.GetOutput(s))
        {
            cout << s << endl;
        }
    }

    while (exec.GetOutput(s))
    {
        cout << s << endl;
    }

    exec.Wait();

    return 0;
}
